#version 120
uniform vec2 modelpos;
uniform float modelrot;
uniform float modelScale;
varying vec3 col;

mat2 rotationMatrix2D(in float angle)
{
	return mat2(cos(angle),sin(angle),-sin(angle),cos(angle));
}

void main()
{
	mat2 rotMat = rotationMatrix2D(modelrot);
	mat2 scaleMat = mat2(modelScale,0.0,0.0,modelScale);
	vec2 pos = rotMat * scaleMat * rotMat * (gl_Vertex.xy + modelpos );
	gl_Position = vec4(pos,0.0,1.0);
	col = gl_Color.rgb;
}

